import unittest
import time
from Unit_01.Base.Base import Base
from selenium.webdriver.common.by import By
class Page1(Base):
    login_loc=(By.CLASS_NAME,'headerLogin')

    uname_loc=(By.ID,'userName')

    password_loc=(By.ID,'password')

    loginbtn_loc=(By.XPATH,'//*[@id="save"]')

    # 确定
    accept_loc=(By.ID,'bindSub')


    def login(self):
        self.click(self.login_loc)

    def uname(self):
        self.send_keys(self.uname_loc,'18986670716')

    def password(self):
        self.send_keys(self.password_loc,'Aa123456')

    def loginbtn(self):
        self.click(self.loginbtn_loc)

    def accept(self):
        self.click(self.accept_loc)

    def jiuxian_luoji1(self):
        self.open_url('https://www.jiuxian.com/')
        self.login()
        self.uname()
        self.password()
        time.sleep(10)
        self.loginbtn()
        self.accept()
# from Unit_01.Base.Base import Base
# from selenium.webdriver.common.by import By
#
# class Page1(Base):
#
#     # 元素定位器
#     # 请登录 class="headerLogin"
#     login_loc=(By.CLASS_NAME,'headerLogin')
#
#     # 用户名输入 name="uname"
#     uname_loc=(By.NAME,'uname')
#
#     # 密码输入 id="password"
#     password_loc=(By.ID,'password')
#
#     # 强制等待 输入文本验证码
#
#     # 点击登录 id="save"
#     loginbtn_loc=(By.ID,'save')
#
#     # 点击确定 id="bindSub"
#     accept_loc=(By.ID,'bindSub')
#
#     # 对请登录的元素定位进行点击操作 class="headerLogin"
#     def login(self):
#         self.click(self.login_loc)
#
#     # 对用户名的元素定位进行输入操作 name="uname"
#     def uname(self):
#         self.send_keys(self.uname_loc,'15253006116')
#
#     # 对密码的元素定位进行输入操作
#     def password(self):
#         self.send_keys(self.password_loc,'Aa123456')
#     # 对登录按钮的元素定位进行点击操作
#     def loginbtn(self):
#         self.click(self.loginbtn_loc)
#
#     # 对确定按钮的元素定位进行点击操作
#     def accept(self):
#         self.click(self.accept_loc)